<div class="wrapper-bz-page" style="height:100%;
    width:100%;
    overflow:hidden;
    position:relative;">
    <div class="common-search-box">
        <input style="width:250px" id="search_input_lib_word_en_in_m62"/>
    </div>
    <div class="wrapper-bz-body has-upper-filter">
        <table id="table_lib_word_en_in_m62" style="width:100%;"></table>
    </div>
</div>
<script>
    $(function () {
        var listTable = [
            {subject_keyword: "lib_word_en_in_m62", datagrid_code: "lib_word_en_m62"},
        ];

        var tableId = "table_" + listTable[0].subject_keyword;
        var searchInputId = "search_input_" + listTable[0].subject_keyword;
        var tableObject_1 = $("#" + tableId);

        var datagridConfigList = $(document).getDatagridConfig(listTable);
        var datagridConfig = datagridConfigList[0];
        datagridConfig.onSelect = function (index, row) {
            var rows = tableObject_1.datagrid("getChecked");
            if(0 == rows.length){
                layer.msg("请选择要加入的单词");
                return false;
            }
            var arrCheckId = [];
            $.each(rows, function(index, item){
                arrCheckId.push(item.id);
            });
            $.ajax({
                url:'/api/LibMovieWord/addMultiLibMovieWordById',
                type:'post',
                data: {movie_id: selectLeftMainId, arr_id: arrCheckId},
                dataType:'json',
                success:function(resp){
                    if(1 == resp.code){
                        $("#table_lib_movie_word_in_m62").datagrid('reload');
                    }else{
                        layer.msg(resp.message);
                    }
                }
            });
        };
        tableObject_1.datagrid(datagridConfig);
        SearchCombobox(searchInputId, tableId, function (val, name) {
            datagridConfig.queryParams[name] = val;
            tableObject_1.datagrid(datagridConfig);
        }, ['CK', 'ID', '创建时间']);
    });
</script>